{% extends "main/base.html" %}
{% load i18n %}
{% block title %}{% trans '更改密码' %}{% endblock %}
{% block content %}
<div class="col-lg-offset-4 col-lg-4">
    <section class="panel">
        <header class="panel-heading">
            {% trans "更改密码" %}
            {% if form.errors %}
            <p>{{ form.non_field_errors }}{% trans "提交的数据有误,请认真检查!" %}</p>
            {% endif %}
        </header>
        <div class="panel-body">
            <form method="post" action="{% url 'main:change_password' %}?next={{ request.path }}" class="form-horizontal">{% csrf_token %}
                <div class="form-group col-sm-12">
                    <input type="password" name="old_password" autofocus="" class="form-control" required="" placeholder="{% trans '旧密码' %}" id="id_old_password">{{form.old_password.errors }}
                </div>
                <div class="form-group col-sm-12">
                    <input type="password" name="new_password1" class="form-control" required="" placeholder="{% trans '新密码' %}" id="id_new_password1">{{ form.new_password1.errors }}
                </div>
                <div class="form-group col-sm-12">
                    <input type="password" name="new_password2" class="form-control" required="" placeholder="{% trans '新密码确认' %}" id="id_new_password2">{{ form.new_password2.errors }}
                </div>
                <div class="form-group col-sm-12">
                    <input type="submit" class="btn btn-primary">
                </div>
            </form>
        </div>
    </section>
</div>
{% endblock %}